package com.city.controller.special;


import com.city.config.BaiduMap;
import com.city.domain.supervise.PubKeyPerson;
import com.city.repository.pub.PubKeyPersonRepository;
import com.city.service.city.impl.CityTownServiceImpl;
import com.city.service.report.impl.CtBranchServiceImpl;
import com.city.service.supervise.ImpLocationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.Map;


/**
 * @ClassName SpecialController
 * @Author 何平
 * @Description  图形化展示界面
 * @Date 8:53 2018/7/21
 **/
@Controller
@RequestMapping("/special")
public class SpecialController {

    @Autowired
    private PubKeyPersonRepository pubKeyPersonRepository;

    @Autowired
    private CityTownServiceImpl cityTownService;

    @Autowired
    private CtBranchServiceImpl ctBranchService;

    @Autowired
    private ImpLocationService locationService;
    /**
     * @Author 何平 
     * @Description  图形化展示主界面
     * @Date 8:55 2018/7/21
     * @Param []
     * @return java.lang.String
     **/
    @RequestMapping("/index")
    public String index(){
        return "/special/index";
    }



    /**
     * @deprecation 地区数据显示页面
     * @author 肖丽娜
     * @date 2018/07/14 17:25
     */
    @RequestMapping("/region_static_show")
    public String region_static_show(Map<String, Object> map) {
        map.put("towns",cityTownService.findName(""));
        map.put("AK", BaiduMap.BAIDU_AK);
        return "/special/region_static_show";
    }

    /**
     * @deprecation 部门数据显示页面
     * @author 肖丽娜
     * @date 2018/07/14 17:25
     */
    @RequestMapping("/depart_static_show")
    public String depart_static_show(Map<String, Object> map) {
        map.put("departs",ctBranchService.findAll());
        return "/special/depart_static_show";
    }





    /**
     * @deprecation 岗位数据显示页面
     * @author 肖丽娜
     * @date 2018/07/14 17:25
     */
    @RequestMapping("/station_static_show")
    public String station_static_show() { return "/special/station_static_show"; }


    /**
     * @Author 何平 
     * @Description  重点人展示
     * @Date 14:24 2018/7/22
     * @Param [map]
     * @return java.lang.String
     **/
    @RequestMapping("/imp_person_show")
    public String imp_person_show(Map<String,Object> map){
        List<PubKeyPerson> list = pubKeyPersonRepository.findAll();
        map.put("AK", BaiduMap.BAIDU_AK);
        map.put("list",list);
        return "/special/imp_person_show";
    }

    
    /**
     * @Author 何平 
     * @Description  重点地点展示
     * @Date 14:25 2018/7/22
     * @Param [map]
     * @return java.lang.String
     **/
    @RequestMapping("/imp_location_show")
    public String imp_location_show(Map<String,Object> map){
        map.put("list",locationService.getAll());
        map.put("AK", BaiduMap.BAIDU_AK);return "/special/imp_location_show";}


    /**
     * @Author 何平 
     * @Description  重点组织展示
     * @Date 15:18 2018/7/22
     * @Param [map]
     * @return java.lang.String
     **/
    @RequestMapping("/imp_organization_show")
    public String imp_organization_show(Map<String,Object> map){ map.put("AK", BaiduMap.BAIDU_AK);return "/special/imp_organization_show";}

}
